/*
============================================================================
FileName	:	XQChatTalkGroup.cpp
Author		:	liyake
Website		:	http://www.liyake.com
Create Data	:	2012-03-08 13:07
Change Data	:	2012-03-08 13:07
Detail		:	The chat dialog of xqchat application
============================================================================
*/
#include "XQChatTalkGroup.h"
#include "XQChatTalkNode.h"
#include <QtGui>

using namespace XQChat;

CXQChatTalkGroup* XQChat::CXQChatTalkGroup::m_pTalkGroup = 0;

CXQChatTalkGroup* XQChat::CXQChatTalkGroup::getXQChatTalkGroup()
{
	if(!m_pTalkGroup)
		m_pTalkGroup = new CXQChatTalkGroup();

	return m_pTalkGroup;
}

XQChat::CXQChatTalkGroup::CXQChatTalkGroup( QGraphicsItem* parent /*= 0*/ )
	: QGraphicsObject(parent)
{
	setFlag(ItemIsMovable);
	setFlag(ItemSendsGeometryChanges);
	setCacheMode(DeviceCoordinateCache);
	setZValue(-2);

	//////////////////////////////////////////////////////////////////////////
	for(int i=0; i<6; ++i)
		CXQChatTalkNode* pNode = new CXQChatTalkNode(this);
}

XQChat::CXQChatTalkGroup::~CXQChatTalkGroup(void)
{

}

QRectF XQChat::CXQChatTalkGroup::boundingRect() const
{
	return QRectF(0,0,400,400);
}

void XQChat::CXQChatTalkGroup::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget /*= 0 */ )
{
	painter->save();
	painter->fillRect(option->rect,QBrush(QColor(0x5e99cd)));
	painter->restore();
}
